const path = require("path");
const { defineConfig } = require("@vue/cli-service");
module.exports = defineConfig({
  transpileDependencies: true,
  configureWebpack: {
    resolve: {
      alias: {
        "@": path.resolve(__dirname, "src"),
      },
    },
  },
  devServer: {
    proxy: {
      "/api": {
        target: "localhost:8181", // API的实际地址
        changeOrigin: true,
        pathRewrite: { "^/api": "" }, // 如果API路径不需要/api前缀，可移除此行
      },
    },
    // 解决页面弹出红色报错遮罩层
    client: {
      //将overlay设置为false即可
      overlay: false,
    },
  },
});
